import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import '../../constants.dart';
import 'logic.dart';

class LegalSearchPage extends StatelessWidget {
  LegalSearchPage({Key? key}) : super(key: key);

  final logic = Get.find<LegalSearchLogic>();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('法律检索'),
        leading: IconButton(
          icon: Icon(
            Icons.arrow_back_ios,
            size: 16.w,
          ),
          onPressed: () {
            Get.back();
          },
        ),
      ),
      body: Center(
          child: Column(
        children: [
          SizedBox(height: kSpaceMedium),
          Padding(
            padding: EdgeInsets.symmetric(horizontal: kSpaceMedium),
            child: SizedBox(
              width: double.infinity,
              height: 100.w,
              child: ElevatedButton(
                onPressed: () {
                  logic.onClickWeike();
                },
                style: ElevatedButton.styleFrom(
                  backgroundColor: Colors.white,
                  surfaceTintColor: Colors.white,
                  shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(kRadiusSmall),
                  ),
                  side: const BorderSide(color: Colors.blue, width: 1),
                ),
                child: Image.asset(
                  'assets/images/weike.png',
                  fit: BoxFit.cover,
                ),
              ),
            ),
          ),
          SizedBox(height: kSpaceMedium),
          Padding(
            padding: EdgeInsets.symmetric(horizontal: kSpaceMedium),
            child: SizedBox(
              width: double.infinity,
              height: 100.w,
              child: ElevatedButton(
                onPressed: () {
                  logic.onClickYuandian();
                },
                style: OutlinedButton.styleFrom(
                  shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(kRadiusSmall),
                  ),
                  side: const BorderSide(color: Colors.blue, width: 1),
                ),
                child: Image.asset(
                  'assets/images/yuandian.png',
                  fit: BoxFit.cover,
                ),
              ),
            ),
          ),
        ],
      )),
    );
  }
}
